<?php

namespace App\Common\Http\Controller;

use App\ApiBaseController;
use App\Common\Services\PrinterService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;


class PrinterController extends ApiBaseController
{

    public function __construct(){
        $this->printerService = new PrinterService();
    }

    /**
     * User:孟郝泽
     * DateTime: 2021/7/01
     * Describe: 添加打印机
     * Version: V1.0
     * @param Request $request
     */
    public function addList(Request $request)
    {
        // 接受参数
        $params = $request->input();
        try {
            $data =$this->printerService->addList($params);
            return $this->success('获取成功', $data);
        } catch (\Exception $exception) {
            return $this->error($exception->getMessage());
        }
    }


    /**
     * User:孟郝泽
     * DateTime: 2021/7/01
     * Describe: 打印机状态查询
     * Version: V1.0
     * @param Request $request
     */
    public function (Request $request)
    {
        // 接受参数
        $params = $request->input();
        try {
            $data =$this->printerService->($params);
            return $this->success('获取成功', $data);
        } catch (\Exception $exception) {
            return $this->error($exception->getMessage());
        }
    }


    /**
     * User:孟郝泽
     * DateTime: 2021/7/01
     * Describe: 打印机状态查询
     * Version: V1.0
     * @param Request $request
     */
    public function msgSend(Request $request)
    {
        // 接受参数
        $params = $request->input();
        try {
            $data =$this->printerService->msgSend($params);
            return $this->success('获取成功', $data);
        } catch (\Exception $exception) {
            return $this->error($exception->getMessage());
        }
    }



}
